<?php

// $Id$

class TCMS_CI_Type_Attr extends Tangra_Class {
	private $id;
	private $ci_type;
	private $attr_type;
	private $name;
	private $hid;
	private $required;
	private $multiple;
	private $params;


	public function set_id($id) {
		tangra_if_not_int_throw_e($id);

		$this->id = $id;
	}


	public function get_id() {
		return $this->id;
	}


	public function set_ci_type($ci_type) {
		tangra_if_not_int_throw_e($ci_type);

		$this->ci_type = $ci_type;
	}


	public function get_ci_type() {
		return $this->ci_type;
	}


	public function set_attr_type($attr_type) {
		tangra_if_not_int_throw_e($attr_type);

		$this->attr_type = $attr_type;
	}


	public function get_attr_type() {
		return $this->attr_type;
	}


	public function set_name($name) {
		$this->name = $name;
	}


	public function get_name() {
		return $this->name;
	}


	public function set_required($required) {
		$this->required = $required ? true : false;
	}


	public function get_required() {
		return $this->required;
	}


	public function set_hid($hid) {
		if (ereg("[a-z0-9_]{1,255}", $hid)) {
			$this->hid = $hid;
		} else {
			throw new Tangra_Module_Exception('Invalid hid: '.$hid.'. Must conform ereg("[a-z0-9_]{1,255}").');
		}
	}


	public function get_hid() {
		return $this->hid;
	}


	public function set_multiple($multiple) {
		$this->multiple = $multiple ? true : false;
	}


	public function get_multiple() {
		return $this->multiple;
	}


	public function set_params($params) {
		$this->params = $params;
	}


	public function get_params() {
		return $this->params;
	}
}